package com.ilove.weather;

import org.kalmeo.kuix.core.model.DataProvider;

public class Province extends DataProvider {

	private static final String ID_PROPERTY = "id";
	private static final String NAME_PROPERTY = "name";
	private static final String INFO_PROPERTY = "info";
	private static final String FrameSequence_PROPERTY = "frameSequence";

	public int id = -1;
	public String name;
	public String info;
	public String frameSequence = "0";

	public void setFrameSequence(String frameSequence) {
		this.frameSequence = frameSequence;
		dispatchUpdateEvent(FrameSequence_PROPERTY);
	}

	public void setInfo(String info) {
		this.info = info;
		dispatchUpdateEvent(INFO_PROPERTY);
	}

	public void setId(int id) {
		this.id = id;
		dispatchUpdateEvent(ID_PROPERTY);
	}
	
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
		dispatchUpdateEvent(NAME_PROPERTY);
	}

	/* (non-Javadoc)
	 * @see org.kalmeo.kuix.core.model.DataProvider#getUserDefinedValue(java.lang.String)
	 */
	protected Object getUserDefinedValue(String property) {
		if (FrameSequence_PROPERTY.equals(property)) {
			return this.frameSequence;
		}
		if (ID_PROPERTY.equals(property)) {
			return Integer.toString(id);
		}
		if (NAME_PROPERTY.equals(property)) {
			return this.name;
		}
		if (INFO_PROPERTY.equals(property)) {
			return this.info;
		}
		return null;
	}


}
